﻿<%@ Page Title="Thông tin chi tiết câu hỏi" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="ThongTinCauHoi.aspx.cs" Inherits="Admin_ThongTinCauHoi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="wrap">
        <h2>
            Thông tin chi tiết câu hỏi
            <asp:HyperLink ID="HyperLink2" runat="server" CssClass="node"
            NavigateUrl="~/Admin/frmAdTaoCH.aspx" BackColor="#F1F1F1" >Hủy bỏ</asp:HyperLink>
        </h2>
    </div>
                
    <div class="wrap" style="border: solid 1px #CCCCCC;">

    <table class="style1">
        <tr style="border: solid 1px #CCCCCC;">
        <td class="style2">
            <asp:Label ID="Label2" runat="server" Text="Nội dung câu hỏi"></asp:Label>
        </td>
        <td class="style2">
            <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                <ContentTemplate>
                    <asp:TextBox ID="txtNoidungCH" runat="server" Height="65px" 
                TextMode="MultiLine" Width="495px"></asp:TextBox>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td class="style2">
            <asp:Button ID="btnXoaCH" runat="server" onclick="btnXoaCH_Click" Text="Xoa CH" CssClass="button"
                    Width="85px" Height="27px" Visible="False" />
        </td>
    </tr>
        <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="Mức độ"></asp:Label>
            </td>
            <td>
                <asp:UpdatePanel ID="UpdatePanel9" runat="server">
                    <ContentTemplate>
                        <asp:DropDownList ID="drplMucdo" runat="server" Width="126px">
                            <asp:ListItem Value="1">TB</asp:ListItem>
                            <asp:ListItem Value="2">Khó</asp:ListItem>
                            <asp:ListItem Value="3">Dễ</asp:ListItem>
                        </asp:DropDownList>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td>
                <asp:Button ID="btnSua" runat="server" onclick="btnSua_Click" Text="Sua CH" CssClass="button"
                        Width="85px" Height="27px" Visible="False" />
            </td>
        </tr>
        <tr>
            <td class="style3">
                <asp:RadioButton ID="rdbA" runat="server" GroupName="cauhoi" Text="Câu A" />
            </td>
            <td class="style3">
                <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                    <ContentTemplate>
                        <asp:TextBox ID="txtA" runat="server" ontextchanged="txtA_TextChanged" Height="34px" TextMode="MultiLine" 
                            Width="492px"></asp:TextBox>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:RadioButton ID="rdbB" runat="server" GroupName="cauhoi" Text="Câu B" />
            </td>
            <td>
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="txtB" runat="server" ontextchanged="txtB_TextChanged" TextMode="MultiLine" Width="492px"></asp:TextBox>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                    </td>

        </tr>
        <tr>
            <td>
                <asp:RadioButton ID="rdbC" runat="server" GroupName="cauhoi" Text="Câu C" />
            </td>
            <td>
                    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="txtC" runat="server" ontextchanged="txtC_TextChanged" TextMode="MultiLine" Width="491px"></asp:TextBox>
                        </ContentTemplate>
                    </asp:UpdatePanel>
            </td>
            <td>
                    &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:RadioButton ID="rdbD" runat="server" GroupName="cauhoi" Text="Câu D" 
                    />
            </td>
            <td>
                    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="txtD" runat="server" ontextchanged="txtD_TextChanged" TextMode="MultiLine" Width="491px"></asp:TextBox>
                        </ContentTemplate>
                    </asp:UpdatePanel>
            </td>
            <td>
                    &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Text="Môn Học"></asp:Label>
            </td>
            <td>
                <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                    <ContentTemplate>
                        <asp:DropDownList ID="drlMonHoc" runat="server" DataSourceID="LinqDataSource1" 
                            DataTextField="TenMonHoc" DataValueField="MsMonHoc" Height="30px" 
                            Width="122px" AutoPostBack="True">
                        </asp:DropDownList>
                        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                            ContextTypeName="DataClassesDataContext" Select="new (MsMonHoc, TenMonHoc)" 
                            TableName="tbl_MONHOCs">
                        </asp:LinqDataSource>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td>
                <asp:Button ID="btnHuy" runat="server" CssClass="button" Height="27px" 
                    onclick="btnHuy_Click" Text="Huy Thao Tac" Visible="False" Width="85px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label5" runat="server" Text="Chương Học"></asp:Label>
            </td>
            <td>
                    <asp:UpdatePanel ID="UpdatePanel11" runat="server">
                        <ContentTemplate>
                            <asp:DropDownList ID="drlChuongHoc" runat="server" Height="30px" 
                                 Width="122px" AutoPostBack="True" DataSourceID="LinqDataSource2" 
                                DataTextField="TenChuong" DataValueField="MaChuong">
                            </asp:DropDownList>
                            <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                                ContextTypeName="DataClassesDataContext" Select="new (MaChuong, TenChuong)" 
                                TableName="tbl_CHUONGHOCs" Where="MsMonHoc == @MsMonHoc">
                                <WhereParameters>
                                    <asp:ControlParameter ControlID="drlMonHoc" Name="MsMonHoc" 
                                        PropertyName="SelectedValue" Type="String" />
                                </WhereParameters>
                            </asp:LinqDataSource>
                        </ContentTemplate>
                    </asp:UpdatePanel>
            </td>
            <td>            &nbsp;</td>
        </tr>
    </table>
    </div>
    
	<div style="padding:4px; margin:3px;">
        <div style="clear: both;"><asp:UpdatePanel ID="UpdatePanel12" runat="server">
            <ContentTemplate>
                <asp:Button ID="btnThemCH" runat="server" onclick="btnThemCH_Click" CssClass="button"
        Text="Lưu câu hỏi" Height="23px" Width="310px" />
            </ContentTemplate>
</asp:UpdatePanel>
&nbsp;</div>
    </div>
    <script type="text/javascript">


        function ktRadioButton() {
            
            if (
                !$("#<%=rdbA.ClientID %>").is(":checked")
                && !$("#<%=rdbB.ClientID %>").is(":checked")
                && !$("#<%=rdbC.ClientID %>").is(":checked")
                && !$("#<%=rdbD.ClientID %>").is(":checked"))
                
            {
                alert("Bạn chưa chọn đáp án nào đúng!");
                return false;
            }
            if($.trim($("#<%=txtNoidungCH.ClientID %>").val()) == 0)
            {
                alert("Chưa có nội dung câu hỏi!");
                return false;
            }
            if (
                (($.trim($("#<%=txtA.ClientID %>").val()) == 0)
                || ($.trim($("#<%=txtB.ClientID %>").val()) == 0)
                || ($.trim($("#<%=txtC.ClientID %>").val()) == 0)
                || ($.trim($("#<%=txtD.ClientID %>").val()) == 0)))
            {
                alert("Thông báo! Có đáp án còn để trống!");
                return false;
                
            }
            if ( 
                (($.trim($("#<%=drlChuongHoc.ClientID %>").val()) == 0)))
            {
                alert("Thông báo! Môn học này chưa có chương nào!");
                return false;
            }
        }
    </script>


</asp:Content>

